package com.ruoyi.eqmonitor.smdtv.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.eqmonitor.smdtv.service.SmregisterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "超图总表")
@RestController
@RequestMapping("/smregister")
public class SmregisterController {

    @Resource
    private SmregisterService smregisterService;

    /**
     * 获取全部注册表信息
     */
    @ApiOperation("获取超图总表信息")
    @GetMapping("/getAll")
    public AjaxResult getAll(){
        return AjaxResult.success(smregisterService.getAll());
    }

    /**
     * 根据name获取注册表数据
     */
    @ApiOperation("根据name获取注册表数据")
    @GetMapping("/getSmdtv")
    public AjaxResult getSmdtv(String smtablename,String name){
        return AjaxResult.success(smregisterService.getSmdtv(smtablename,name));
    }

    /**
     * 统计水系各数量
     */
    @ApiOperation("统计水系各数量")
    @GetMapping("/getSum")
    public AjaxResult getSum(String name){
        return AjaxResult.success(smregisterService.getSum(name));
    }

}
